<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-body">
                    <table id="exampleTable" data-mobile-responsive="true">
                        <ul id="myTab" class="nav nav-tabs">
                            <li class="active"><a href="#home" data-toggle="tab">
                                同步服务器地址设置</a></li>
                            <li><a href="#ios" data-toggle="tab" >系统参数设置</a></li>
                            <li><a href="#shenpi" data-toggle="tab">审批设置</a></li>
                            <li><a href="#shouquan" data-toggle="tab">授权管理</a></li>
                        </ul>
                        <div id="myTabContent" class="tab-content">
                            <div class="tab-pane fade in active" id="home">
                                <div class="panel panel-default">
                                    <div class="panel-collapse collapse in">
                                        <div class="panel-body">
                                            <form class="form-horizontal m-t" id="signupForm2">
                                            <label for="ip" class="control-label">同步服务器ip:</label>
                                            <div>
                                                <input type="text" class="form-control" id="synchroIp" name="synchroIp"
                                                       placeholder="请输入ip">
                                            </div>
                                            <br>
                                            <label for="port" class="control-label">同步服务器端口:</label>
                                            <div>
                                                <input type="text" class="form-control" id="synchroPort" name="synchroPort"
                                                       placeholder="请输入端口">
                                            </div>
                                            <br>
                                            <button type="button" onclick="savePort()" class="btn btn-primary">保存</button>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="tab-pane fade" id="ios">
                                <div class="panel panel-default">
                                    <div class="panel-collapse collapse in">
                                        <div class="panel-body">
                                            <form class="form-horizontal m-t" id="signupForm">
                                                <label for="diskSave" class="control-label">系统参数设置:</label>
                                                <div>
                                                     <input type="text" class="form-control" id="diskSave" name="setValue"
                                                       placeholder="请输入名字">
                                                     </div>
                                                 <br>
                                                 <button onclick="saveDiskSave()" type="button" class="btn btn-primary">保存</button>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="tab-pane fade" id="shenpi">

                                <div class="panel panel-default">
                                    <div id="collapseThree" class="panel-collapse collapse in">
                                        <div class="panel-body">
                                            <h4>启用文件发送审批</h4>
                                            <p>关闭开关后，文件的发送将不需要审批</p>
                                            <div class="switchOn switchOff" id="enableFileAuidtOn">
                                                <em></em>
                                            </div>
                                        </div>
                                        <div class="panel-body" id="noAuidt">
                                            <h4>启用文件类型免审批策略</h4>
                                            <p>该列表中的文件类型发送时，不经过审批直接发送</p>
                                            <div class="switchOn switchOff" id="noAuidtTypeOn">
                                                <em></em>
                                            </div>
                                            <div id="typeOn">
                                                <p onclick="showInput('noAuidtFile')"><span class="panel-jia">+</span><span>&nbsp;&nbsp;&nbsp;</span>添加免审批文件类型</p>
                                                <div class="type_pp"></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>


                                <div class="panel panel-default">
                                    <div class="panel-heading">
                                        <h3 class="panel-title">
                                            <a data-toggle="collapse" data-parent="#accordion"
                                               href="#collapseFour">
                                                禁止发送设置
                                            </a>
                                        </h3>
                                    </div>
                                    <div id="collapseFour" class="panel-collapse collapse in">
                                        <div class="panel-body" id="forbidType">
                                            <h4>启用文件类型禁止发送策略</h4>
                                            <p>该列表中的文件类型禁止发送</p>
                                            <div class="switchOn switchOff" id="forbidFileType">
                                                <em></em>
                                            </div>
                                            <div id="forbid">
                                                <p onclick="showInput('forbidType')"><span class="panel-jia">+</span><span>&nbsp;&nbsp;&nbsp;</span>添加禁止发送文件类型</p>
                                                <div class="type_forbid"></div>
                                            </div>
                                        </div>

                                        <div class="panel-body" id="Keyword">
                                            <h4>启用文件关键字禁止发送策略</h4>
                                            <p>包含关键字的文件禁止发送</p>
                                            <div class="switchOn switchOff" id="forbidKeyword">
                                                <em></em>
                                            </div>
                                            <div id="forbidKeywordFile">
                                                <p onclick="showInput('Keyword')"><span class="panel-jia">+</span><span>&nbsp;&nbsp;&nbsp;</span>添加禁止发送关键字</p>
                                                <div class="type_Keyword"></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="tab-pane fade" id="shouquan">
                                <div class="panel panel-default">
                                    <div class="panel-collapse collapse in">
                                        <div class="panel-body">
                                            <form class="form-horizontal m-t" id="form4">
                                                <label for="diskSave" class="control-label">机器码:</label>
                                                <div>
                                                    <input type="text" class="form-control" name="setValue" readonly>
                                                </div>
                                                <br>
                                                <label for="diskSave" class="control-label">用户名称:</label>
                                                <div>
                                                    <input type="text" class="form-control" name="setValue" readonly>
                                                </div>
                                                <br>
                                                <label for="diskSave" class="control-label">授权点数:</label>
                                                <div>
                                                    <input type="text" class="form-control" name="setValue" readonly>
                                                </div>
                                                <br>
                                                <label for="diskSave" class="control-label">维保日期:</label>
                                                <div>
                                                    <input type="text" class="form-control" name="setValue" readonly>
                                                </div>
                                                <br>
                                                <label for="diskSave" class="control-label">产品授权日期:</label>
                                                <div>
                                                    <input type="text" class="form-control" name="setValue" readonly>
                                                </div>
                                                <br>
                                                <label for="diskSave" class="control-label">版本信息:</label>
                                                <div>
                                                    <input type="text" class="form-control" id="version" readonly>
                                                </div>
                                                <br>
                                                <!--<input type="file" value="" id="authorizeFile" name="authorizeFile"/>-->
                                                <input type="file" style="display: none" id="authorizeFile" onchange="uploadAuthorizeFile();"/>
                                                <a href="javascript:void(0)" class="btn btn-primary myDropdown">导入授权</a>
                                                <!--<button onclick="uploadAuthorizeFile();" type="button" class="btn btn-primary" style="margin-top: 10px;">导入授权</button>-->
                                            </form>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <!--shiro控制bootstraptable行内按钮看见性 来自bootdo的创新方案 -->
</div>
<div th:include="include :: footer"></div>
<script type="text/javascript" src="/js/appjs/system/set/sysSet.js"></script>
<script>

    $(".myDropdown").click(function () {
        $("#authorizeFile").click();
    })

    function uploadAuthorizeFile() {
        var formData = new FormData();
        var file1 = $('#authorizeFile').get(0).files[0];
        if(file1 == null || file1 == '') {
            parent.layer.alert("请选择授权文件");
            return false;
        }
        formData.append('file', file1);
        $.ajax({
            url: "/common/sysFile/uploadAuthorizeFile",
            cache : false,
            contentType : false,
            processData : false,
            dataType : "json",
            type : "POST",
            data: formData,
            success: function (data) {
                if (data.code == 0) {
                    parent.layer.msg(data.msg);
                } else {
                    parent.layer.alert(data.msg)
                }
                $("#authorizeFile").val("");
            }
        });
    }
</script>
<style type="text/css">
    .panel-body{
        border-bottom: 1px solid #eee;
        position: relative;
    }
    .panel-jia{
        display: inline-block;
        width:22px;
        height:22px;
        border:1px solid #0e9aef;
        border-radius:50%;
        background: #0e9aef;
        color: white;
        text-align: center;
    }
    .panel-jian{
        display: inline-block;
        width:22px;
        height:22px;
        border:1px solid red;
        border-radius:50%;
        background: red;
        color: white;
        text-align: center;
    }
    *{
        margin: 0px;
        padding: 0px;
    }
    .switchOn {
        display: inline-block;
        width: 50px;
        height: 22px;
        border-radius: 22px;
        background-color: #009f3c;
        position: relative;
        vertical-align: top;
        cursor: pointer;
        position: relative;
        top: -45px;
        left: 400px;
    }
    .switchOn em {
        display: inline-block;
        width: 18px;
        height: 18px;
        border-radius:50%;
        background:#FFFFFF;
        position: absolute;
        right: 2px;
        top: 2px;
        transition: all 0.5s linear;
    }
    .switchOn:after{
        content: 'ON';
        font-size: 12px;
        position: absolute;
        left:6px;
        top: 4px;
        color: #FFFFFF;
    }
    .switchOn.switchOff{
        background-color: red;
    }
    .switchOn.switchOff em{
        left: 2px;
    }
    .switchOn.switchOff:after{
        content: '';
    }
    .switchOn.switchOff:before{
        content: 'OFF';
        font-size: 12px;
        position: absolute;
        right:5px;
        top: 4px;
        color: #FFFFFF;
    }
</style>
</body>
</html>